package com.ocom.wxapi.client;

import com.alibaba.fastjson.JSONObject;
import com.ocom.common.constant.CompanyServiceUrl;
import com.ocom.common.constant.HumanServiceUrl;
import com.ocom.common.dto.CompanyInfoDto;
import com.ocom.common.dto.Department;
import com.ocom.common.entity.human.EntityDeptInfo;
import com.ocom.common.entity.master.EntityMngUserInfo;
import com.ocom.common.entity.master.EntityWechatPerInfo;
import com.ocom.common.request.human.StudentsDateOnlineRequest;
import com.ocom.common.request.human.StudentsDetailRequest;
import com.ocom.common.request.human.StudentsKqBydaysDetailRequest;
import com.ocom.common.request.human.StudentsOnlineRequest;
import com.ocom.common.request.wx.UserInfoPageUpdateUserRequest;
import com.ocom.common.request.wx.UserPageAddUserRequest;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.PageListResult;
import com.ocom.common.vo.PersonVo;
import com.ocom.common.vo.human.KqStudentVo;
import com.ocom.common.vo.human.UserInfoVo;
import com.ocom.common.vo.human.UserInfoYkmVo;
import com.ocom.common.vo.webapi.PageVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;


@FeignClient(value = "human")
public interface HumanClientService {

    @PostMapping(value = "/test")
    Result getAuth(@RequestParam("clientId")String clientId, @RequestParam("userId")String userId);


    /**
     * 添加微信用户
     * @param wechatPerInfo
     */
    @PostMapping(HumanServiceUrl.URLP_HUAMN_ADD_WXPER)
    Result addWxper(@RequestBody EntityWechatPerInfo wechatPerInfo);


    @PostMapping(CompanyServiceUrl.URL_UpdateCompanyInfo)
    Result UpdateCompanyInfo(@RequestBody CompanyInfoDto companyInfo);


    @GetMapping(HumanServiceUrl.URL_Department_GetDeptInfo)
    Result GetDeptInfo(@RequestParam("comID")Long comID,@RequestParam("deptID") Long deptID,@RequestParam("deptName")String deptName );


//    @PostMapping(HumanServiceUrl.URLP_getPersonInfo)
//    Result getPersonInfo(@RequestParam("companyId")Long companyId,@RequestParam("deptId") Long deptId);




    /*
     * @Description:2.1.5获取部门id（department/getDeptIds）
     * @Author: lu
     * @Date: 2022/4/22 10:30
     * @param department:
     * @return: com.ocom.common.resp.Result
     **/
    @PostMapping(HumanServiceUrl.URL_DepartmentGetDeptIds)
    public Result getDeptIds(@Validated @RequestBody Map<String,Object> map);

    @PostMapping(HumanServiceUrl.URLP_updateUserPage)
    Result  updateUser(@RequestBody UserInfoPageUpdateUserRequest request);


    /**修改人员信息*/
    @PostMapping(HumanServiceUrl.URL_PersonnelUpdatePerson)
    Result UpdatePerson(@RequestBody PersonVo personVo);

    @PostMapping(HumanServiceUrl.URLP_updateUserState)
    Result  updateUserStatus(@RequestParam("companyId")Long companyId,@RequestParam("pId")Long pId,@RequestParam("status")Integer status);




    @PostMapping(HumanServiceUrl.URLP_addPerUser)
    Result  addPerUser(@RequestBody UserPageAddUserRequest request);

    /**
     * 新增人员信息
     * */
    @PostMapping(HumanServiceUrl.URL_PersonnelAddPerson)
    Result AddPerson(@RequestBody PersonVo personVo);

    @PostMapping(HumanServiceUrl.URLP_getWxUserByPid)
    Result getWxUserByPid(@RequestParam("companyId")Long companyId,@RequestParam("pId")Long pId);


    @PostMapping(HumanServiceUrl.URLP_getEcardRegCode)
    Result getEcardRegCode(@RequestParam("companyId")Long companyId,@RequestParam("pId")Long pId);


    @PostMapping(HumanServiceUrl.URLP_addEcardRegCode)
    Result addEcardRegCode(@RequestParam("companyId")Long companyId,@RequestParam("pId") Long pId,@RequestParam("regCode") String regCode,@RequestParam("endTime") String endTime);

//    @PostMapping(HumanServiceUrl.URLP_existPerson)
//    Result existPerson(@RequestParam("companyId")Long companyId, @RequestParam("phone")String phone,@RequestParam("idCard") String idCard);


    @PostMapping(HumanServiceUrl.URLP_removePerson)
    Result  removePerson(@RequestParam("companyId")Long companyId,@RequestParam("pId")Long pId,@RequestParam("userId")Long userId);

    /**
     * 获取人员列表personnel/getPersonInfo
     * */
    @PostMapping(HumanServiceUrl.URL_PersonnelGetPersonInfo)
    public Result PersonnelGetPersonInfo(@RequestBody Map<String,Object> map);



    /**
     * 获取人员信息 getPersonInfo
     * */
    @GetMapping(HumanServiceUrl.URL_GetPersonInfo)
    public Result GetPersonInfo(@RequestParam("comId")Long comId,@RequestParam("pId")Long pId);


    //获取下级部门信息（department/getDeptInfos）
    @PostMapping(HumanServiceUrl.URL_DepartmentGetDeptInfos)
    public Result departmentGetDeptInfos(@RequestBody Department deleteDeptDto);


    @PostMapping(HumanServiceUrl.URL_GetMngUserInfo)
    public Result<PageListResult<EntityMngUserInfo>> getMngUserInfo(@RequestBody JSONObject jsonObject);

    @PostMapping(HumanServiceUrl.URL_getSaasMenuByRole)
    public Result getSaasMenuByRole(@RequestBody JSONObject jsonObject);

    @PostMapping(HumanServiceUrl.URL_getMngUserInfoById)
    public Result getMngUserInfoById(@RequestParam("userId")Integer userId) ;

    @PostMapping(HumanServiceUrl.URL_getPageEnumByType)
    public Result getPageEnumByType(@RequestParam("type") String type);

    @PostMapping(HumanServiceUrl.URL_PersonnelGetPersonInfo)
    public Result<PageVO<UserInfoYkmVo>> PersonnelGetPersonInfo(@Validated @RequestBody UserInfoVo userInfoVo) ;

    @PostMapping(HumanServiceUrl.URL_getKqAndStudentsOnline)
    public Result<List<KqStudentVo>> getKqAndStudentsOnline(@RequestBody StudentsOnlineRequest request);


    @PostMapping(HumanServiceUrl.URL_getKqAndStudentsDetail)
    public Result getKqAndStudentsDetail(@RequestBody StudentsDetailRequest request);

    @PostMapping(HumanServiceUrl.URL_Department_GetDeptList)
    public Result<List<EntityDeptInfo>> getDeptList(@RequestParam("companyId") Long companyId, @RequestParam("deptId") Long deptId, @RequestParam("show") Integer show);


    @PostMapping(HumanServiceUrl.URL_getStudentDateKq)
    public Result getStudentDateKq(@RequestBody StudentsDateOnlineRequest request) ;


    @PostMapping(HumanServiceUrl.URL_studentsKqBydaysDetail)
    public Result studentsKqBydaysDetail(@RequestBody StudentsKqBydaysDetailRequest request);

}
